home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / sos3-2.lha / include / X11 / Xaw / Text.h < prev   
Encoding:
C/C++ Source or Header  |  1991-03-14  |  10.1 KB  |  369 lines

  1. /*
  2. * $XConsortium: Text.h,v 1.32 89/10/19 15:01:11 kit Exp $
  3. */
  4.  
  5.  
  6. /***********************************************************
  7. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  8. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  9.  
  10.                         All Rights Reserved
  11.  
  12. Permission to use, copy, modify, and distribute this software and its 
  13. documentation for any purpose and without fee is hereby granted, 
  14. provided that the above copyright notice appear in all copies and that
  15. both that copyright notice and this permission notice appear in 
  16. supporting documentation, and that the names of Digital or MIT not be
  17. used in advertising or publicity pertaining to distribution of the
  18. software without specific, written prior permission.  
  19.  
  20. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  21. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  22. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  23. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  24. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  25. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  26. SOFTWARE.
  27.  
  28. ******************************************************************/
  29.  
  30. #ifndef _XawText_h
  31. #define _XawText_h
  32.  
  33. #include <X11/Xaw/TextSink.h>
  34. #include <X11/Xaw/TextSrc.h>
  35.  
  36. /****************************************************************
  37.  *
  38.  * Text widget
  39.  *
  40.  ****************************************************************/
  41.  
  42. /* Parameters:
  43.  
  44.  Name             Class        RepType        Default Value
  45.  ----             -----        -------        -------------
  46.  background         Background        Pixel        XtDefaultBackground
  47.  border             BorderColor    Pixel        XtDefaultForeground
  48.  borderWidth         BorderWidth    Dimension    1
  49.  destroyCallback     Callback        Pointer        NULL
  50.  dialogHOffset         Margin        int        10
  51.  dialogVOffset         Margin        int        10
  52.  displayCaret         Output        Boolean        True
  53.  displayPosition     TextPosition    int        0
  54.  editType         EditType        XtTextEditType    XttextRead
  55.  height             Height        Dimension    font height
  56.  insertPosition         TextPosition    int        0
  57.  leftMargin         Margin        Dimension    2
  58.  mappedWhenManaged   MappedWhenManaged    Boolean        True
  59.  selectTypes         SelectTypes    Pointer        (internal)
  60.  selection         Selection        Pointer        empty selection
  61.  sensitive         Sensitive        Boolean        True
  62.  textSink         TextSink        Pointer        (none)
  63.  textSource         TextSource        Pointer        (none)
  64.  width             Width        Dimension    100
  65.  x             Position        int        0
  66.  y             Position        int        0
  67.  
  68. */
  69.  
  70. #define XtEtextScrollNever "never"
  71. #define XtEtextScrollWhenNeeded "whenneeded"
  72. #define XtEtextScrollAlways "always"
  73.  
  74. #define XtEtextWrapNever "never"
  75. #define XtEtextWrapLine "line"
  76. #define XtEtextWrapWord "word"
  77.  
  78. #define XtEtextResizeNever "never"
  79. #define XtEtextResizeWidth "width"
  80. #define XtEtextResizeHeight "height"
  81. #define XtEtextResizeBoth "both"
  82.  
  83. #define XtNautoFill "autoFill"
  84. #define XtNbottomMargin "bottomMargin"
  85. #define XtNdialogHOffset "dialogHOffset"
  86. #define XtNdialogVOffset "dialogVOffset"
  87. #define XtNdisplayCaret "displayCaret"
  88. #define XtNdisplayPosition "displayPosition"
  89. #define XtNinsertPosition "insertPosition"
  90. #define XtNleftMargin "leftMargin"
  91. #define XtNresize "resize"
  92. #define XtNrightMargin "rightMargin"
  93. #define XtNscrollVertical "scrollVertical"
  94. #define XtNscrollHorizontal "scrollHorizontal"
  95. #define XtNselectTypes "selectTypes"
  96. #define XtNselection "selection"
  97. #define XtNtopMargin "topMargin"
  98. #define XtNwrap "wrap"
  99.  
  100. #define XtCAutoFill "AutoFill"
  101. #define XtCResize "Resize"
  102. #define XtCScroll "Scroll"
  103. #define XtCSelectTypes "SelectTypes"
  104. #define XtCWrap "Wrap"
  105.  
  106. /* Return Error code for XawTextSearch */
  107.  
  108. #define XawTextSearchError      (-12345L)
  109.  
  110. /* Return codes from XawTextReplace */
  111.  
  112. #define XawEditDone        0
  113. #define XawEditError        1
  114. #define XawPositionError    2
  115.  
  116. extern Atom FMT8BIT;
  117.  
  118. /* Class record constants */
  119.  
  120. extern WidgetClass textWidgetClass;
  121.  
  122. typedef struct _TextClassRec *TextWidgetClass;
  123. typedef struct _TextRec      *TextWidget;
  124.  
  125. /* other stuff */
  126.  
  127. typedef enum { XawtextScrollNever,
  128.            XawtextScrollWhenNeeded, XawtextScrollAlways} XawTextScrollMode;
  129.  
  130. typedef enum { XawtextWrapNever, 
  131.            XawtextWrapLine, XawtextWrapWord} XawTextWrapMode;
  132.  
  133. typedef enum { XawtextResizeNever, XawtextResizeWidth,
  134.            XawtextResizeHeight, XawtextResizeBoth} XawTextResizeMode;
  135.  
  136. typedef enum {XawsdLeft, XawsdRight} XawTextScanDirection;
  137. typedef enum {XawtextRead, XawtextAppend, XawtextEdit} XawTextEditType;
  138. typedef enum {XawselectNull, XawselectPosition, XawselectChar, XawselectWord,
  139.     XawselectLine, XawselectParagraph, XawselectAll} XawTextSelectType;
  140.  
  141. typedef struct {
  142.     int  firstPos;
  143.     int  length;
  144.     char *ptr;
  145.     Atom format;
  146.     } XawTextBlock, *XawTextBlockPtr; 
  147. #ifdef XAW_BC
  148. /************************************************************
  149.  *
  150.  * This Stuff is only for compatibility, and will go away in 
  151.  * future releases.                                         */
  152.  
  153. /* preserved for Back Compatability only. */
  154.  
  155. #define XawTextSource Widget
  156. #define XtTextSource  Widget
  157.  
  158. #define wordBreak        0x01
  159. #define scrollVertical        0x02
  160. #define scrollHorizontal    0x04
  161. #define scrollOnOverflow    0x08
  162. #define resizeWidth        0x10
  163. #define resizeHeight        0x20
  164. #define editable        0x40
  165.  
  166. typedef long XtTextPosition;
  167.  
  168. #define XtTextBlock                XawTextBlock
  169. #define XtTextBlockPtr             XawTextBlockPtr
  170.  
  171. #define EditDone               XawEditDone
  172. #define EditError               XawEditError
  173. #define PositionError               XawPositionError
  174.  
  175. #define XtEditDone               XawEditDone
  176. #define XtEditError               XawEditError
  177. #define XtPositionError               XawPositionError
  178.  
  179. #define XttextRead                 XawtextRead
  180. #define XttextAppend               XawtextAppend
  181. #define XttextEdit                 XawtextEdit
  182. #define XtTextEditType             XawTextEditType
  183. #define XtselectNull               XawselectNull
  184.  
  185. #define XtselectPosition           XawselectPosition
  186. #define XtselectChar               XawselectChar
  187. #define XtselectWord               XawselectWord
  188. #define XtselectLine               XawselectLine
  189. #define XtselectParagraph          XawselectParagraph
  190. #define XtselectAll                XawselectAll
  191. #define XtTextSelectType           XawTextSelectType
  192.  
  193. #define XtTextDisableRedisplay     XawTextDisableRedisplay
  194. #define XtTextEnableRedisplay      XawTextEnableRedisplay
  195. #define XtTextGetSource            XawTextGetSource
  196.  
  197. #define XtTextDisplay              XawTextDisplay
  198. #define XtTextDisplayCaret         XawTextDisplayCaret
  199. #define XtTextSetSelectionArray    XawTextSetSelectionArray
  200. #define XtTextSetLastPos           XawTextSetLastPos
  201. #define XtTextGetSelectionPos      XawTextGetSelectionPos
  202. #define XtTextSetSource            XawTextSetSource
  203. #define XtTextReplace              XawTextReplace
  204. #define XtTextTopPosition          XawTextTopPosition
  205. #define XtTextSetInsertionPoint    XawTextSetInsertionPoint
  206. #define XtTextGetInsertionPoint    XawTextGetInsertionPoint
  207. #define XtTextUnsetSelection       XawTextUnsetSelection
  208. #define XtTextChangeOptions        XawTextChangeOptions
  209. #define XtTextGetOptions           XawTextGetOptions
  210. #define XtTextSetSelection         XawTextSetSelection
  211. #define XtTextInvalidate           XawTextInvalidate
  212.  
  213. #define XtDiskSourceCreate         XawDiskSourceCreate
  214. #define XtDiskSourceDestroy        XawDiskSourceDestroy
  215. #define XtStringSourceCreate       XawStringSourceCreate
  216. #define XtStringSourceDestroy      XawStringSourceDestroy
  217.  
  218. extern void XawTextChangeOptions(
  219. #if NeedFunctionPrototypes
  220. ...
  221. #endif
  222. ); /* w, options */
  223.     /* Widget        w;        */
  224.     /* int    options; */
  225.  
  226. extern int XawTextGetOptions(
  227. #if NeedFunctionPrototypes
  228. ...
  229. #endif
  230. ); /* w */
  231.     /* Widget        w;        */
  232.  
  233. extern void XawTextSetLastPos(
  234. #if NeedFunctionPrototypes
  235. ...
  236. #endif
  237. ); /* w, lastPos */
  238.     /* Widget        w;        */
  239.     /* XawTextPosition lastPos;  */
  240.  
  241. /*************************************************************/
  242. #endif /* XAW_BC */
  243.  
  244. extern void XawTextDisplay(
  245. #if NeedFunctionPrototypes
  246. ...
  247. #endif
  248. ); /* w */
  249.     /* Widget w; */
  250.  
  251. extern void XawTextEnableRedisplay(
  252. #if NeedFunctionPrototypes
  253. ...
  254. #endif
  255. ); /* w */
  256.     /* Widget w; */
  257.  
  258. extern void XawTextDisableRedisplay(
  259. #if NeedFunctionPrototypes
  260. ...
  261. #endif
  262. ); /* w */
  263.     /* Widget w; */
  264.  
  265. extern void XawTextSetSelectionArray(
  266. #if NeedFunctionPrototypes
  267. ...
  268. #endif
  269. ); /* w, sarray */
  270.     /* Widget        w;        */
  271.     /* SelectionType *sarray;   */
  272.  
  273. extern void XawTextGetSelectionPos(
  274. #if NeedFunctionPrototypes
  275. ...
  276. #endif
  277. ); /* dpy, w, left, right */
  278.     /* Widget        w;        */
  279.     /* XawTextPosition *left, *right;    */
  280.  
  281. extern void XawTextSetSource(
  282. #if NeedFunctionPrototypes
  283. ...
  284. #endif
  285. ); /* dpy, w, source, startPos */
  286.     /* Widget         w;        */
  287.     /* XawTextSource   source;       */
  288.     /* XawTextPosition startPos;     */
  289.  
  290. extern int XawTextReplace(
  291. #if NeedFunctionPrototypes
  292. ...
  293. #endif
  294. ); /* w, startPos, endPos, text */
  295.     /* Widget        w;        */
  296.     /* XawTextPosition   startPos, endPos; */
  297.     /* XawTextBlock      *text; */
  298.  
  299. extern XawTextPosition XawTextTopPosition(
  300. #if NeedFunctionPrototypes
  301. ...
  302. #endif
  303. ); /* w */
  304.     /* Widget        w;        */
  305.  
  306. extern void XawTextSetInsertionPoint(
  307. #if NeedFunctionPrototypes
  308. ...
  309. #endif
  310. ); /*  w, position */
  311.     /* Widget        w;        */
  312.     /* XawTextPosition position; */
  313.  
  314. extern XawTextPosition XawTextGetInsertionPoint(
  315. #if NeedFunctionPrototypes
  316. ...
  317. #endif
  318. ); /* w */
  319.     /* Widget        w;        */
  320.  
  321. extern void XawTextUnsetSelection(
  322. #if NeedFunctionPrototypes
  323. ...
  324. #endif
  325. ); /* w */
  326.     /* Widget        w;        */
  327.  
  328. extern void XawTextSetSelection(
  329. #if NeedFunctionPrototypes
  330. ...
  331. #endif
  332. ); /* w, left, right */
  333.     /* Widget        w;        */
  334.     /* XawTextPosition left, right; */
  335.  
  336. extern void XawTextInvalidate(
  337. #if NeedFunctionPrototypes
  338. ...
  339. #endif
  340. ); /* w, from, to */
  341.     /* Widget        w;        */
  342.     /* XawTextPosition from, to; */
  343.  
  344. extern Widget XawTextGetSource(
  345. #if NeedFunctionPrototypes
  346. ...
  347. #endif
  348. ) ; /* w */
  349.     /* Widget        w;        */
  350.  
  351. extern XawTextPosition XawTextSearch(
  352. #if NeedFunctionPrototypes
  353. ...
  354. #endif
  355. ) ; /* w, dir, text */
  356.     /* Widget        w;         */
  357.     /* XawTextScanDirection dir; */
  358.     /* XawTextBlock      *text;  */
  359.  
  360. /*
  361.  * For R3 compatability only. 
  362.  */
  363.  
  364. #include <X11/Xaw/AsciiSrc.h>
  365. #include <X11/Xaw/AsciiSink.h>
  366.  
  367. #endif /* _XawText_h */
  368. /* DON'T ADD STUFF AFTER THIS #endif */
  369.